<!doctype html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  
  <meta name="generator" content="Hugo 0.98.0" />

  
  <meta name="description" content="走在通往幸福的路上">
  

  
  <link rel="apple-touch-icon" sizes="180x180" href="https://blog.v5u.win/apple-touch-icon.png">

  
  <link rel="icon" type="image/png" sizes="32x32" href="https://blog.v5u.win/favicon-32x32.png">

  
  <link rel="icon" type="image/png" sizes="16x16" href="https://blog.v5u.win/favicon-16x16.png">

  
  <link rel="manifest" href="https://blog.v5u.win/site.webmanifest">

  
  <link rel="mask-icon" href="https://blog.v5u.win/safari-pinned-tab.svg" color="">

  <meta name="msapplication-TileColor" content="">

  <meta name="theme-color" content="">

  
  <link rel="stylesheet" href="https://blog.v5u.win/css/bootstrap.min.css" />

  
  <title>vscode安装golang.org的golint | 为吾优</title>
  

  <style>
body {
  min-width: 300px;
}

.custom-navbar {
  margin-bottom: 1em;
  height: 60px;
}

.custom-navbar a {
  display: inline-block; 
  padding: 18px 0;
  margin-right: 1em; 
  font-weight: bold; 
}

.custom-navbar a:hover,
.custom-navbar a:focus {
  text-decoration: none; 
}

@media print {
  .custom-navbar {
    display: none;
  }
}

article {
  padding-bottom: 1em;
}

img {
  max-width: 100%;
}


body {
  background-color: #fff;
}



body {
  color: #212529;
}



a {
  color: #007bff;
}



a:hover,
a:focus {
  color: #0056b3;
}



.custom-navbar {
  background-color: #212529;
}



.custom-navbar a {
  color: rgba(255,255,255,.75);
}



.custom-navbar a:hover,
.custom-navbar a:focus {
  color: rgba(255,255,255,1);
}



.container {
  max-width: 800px;
}





</style>
</head>

<body>
  <nav class="custom-navbar">
  <div class="container">
    
    <a href="/">文章</a>
    
    <a href="/tags/">标签</a>
    
    <a href="/about/">关于</a>
    
    <a href="/index.xml">RSS</a>
    
  </div>
</nav>
  
  <div class="container">
    <article>
      <h1>vscode安装golang.org的golint</h1>
<p>vscode 安装了 go 插件后，一些 Extensions 无法通过 vscode 自动安装，此时可以手动从控制台安装。下面是一些基础标准库</p>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<p>其中 golint guru gorename 需要手动编译。</p>
<p>因为GitHub中的golint需要拉取golang.org中的资源，但是golang.org资源无法获取。所以需要手动编译安装。</p>
<h5 id="安装golint">安装golint：</h5>
<ol>
<li>
<p><code>cd $GOPATH/src</code> 进入 GOPATH 目录下<!-- raw HTML omitted --></p>
</li>
<li>
<p><code>mkdir golang.org/x</code> 创建 golang.org/x 目录</p>
</li>
<li>
<p><code>cd golang.org/x</code></p>
</li>
<li>
<p><code>git clone https://github.com/golang/tools.git tools</code> 下载 golang tools</p>
</li>
<li>
<p><code>git clone https://github.com/golang/lint</code> git clone golang/lint (如果github.com/golang 目录下已经有了 lint 也可以 copy 过来)</p>
</li>
<li>
<p><code>go install github.com/golang/lint/golint</code> 编译 golint</p>
</li>
<li>
<p>查看 gobin 目录下是否有了golint</p>
</li>
</ol>
<p>解释：</p>
<p>解决方法是</p>
<p>使用终端切换到$GOPATH</p>
<p>按照下面目录结构来新建缺失的文件夹</p>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<p>通过 <code>$ git clone git@github.com:golang/tools.git</code> 命令手动下载tools包</p>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<p>要能debug需要安装另外一个工具delve 。</p>
<p>安装方法见<a href="https://github.com/derekparker/delve/blob/master/Documentation/installation/README.md">链接</a>中找到对应的系统来安装delve工具。</p>

    </article>
  </div>

  
  
  

  
</body>

</html>